//
//  BaseFlipView.h
//  BaoVn
//
//  Created by Le Anh Tai on 11/6/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BaseFlipViewItem.h"

@protocol FlipViewDelegate;
@class BaseNewsItemView;
@interface BaseFlipView : UIView<UIGestureRecognizerDelegate, BaseFlipViewItemDelegate>
{
    BaseFlipViewItem *_detailTempView;
    BaseFlipViewItem *_detailCurrentView;
    
    //pan gesture
    CGFloat _preTouchY;
    UIView *_movingView;
    CGFloat _anchorTempTop;
    CGFloat _anchorTempBottom;
}

@property (nonatomic, assign) NSInteger selectedIndex;
@property (nonatomic, weak) id<FlipViewDelegate> delegate;

//item above
- (BaseFlipViewItem*)instanceForCurrentSwipeItem;

//item under
- (BaseFlipViewItem*)instanceForTempSwipeItem;

- (id)dataForViewAtIndex:(NSInteger)index;
- (NSInteger)numberOfItemsForEachFlip;
- (void)didSelectFlipItem:(NSInteger)pageNumber;

@end

@protocol FlipViewDelegate <NSObject>

- (void)flipView:(BaseFlipView *)view didSelectData:(NSDictionary *)data;
- (void)flipView:(BaseFlipView *)view didSelectPage:(NSInteger)pageNumber;

@end
